/**
 * 
 */
package demo.sql;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import demo.framework.BaseTestCase;

/**
 * @author Administrator
 * 
 */
public class BaseJDBCTestCase extends BaseTestCase {

    /**
     * @return
     * @throws SQLException
     */
    protected Connection getConnection() throws SQLException {
        final String JDBC_DRIVER = "com.ibm.db2.jcc.DB2Driver";
        final String JDBC_URL = "jdbc:db2://localhost:50000/TEST";
        final String JDBC_USERNAME = "administrator";
        final String JDBC_PASSWORD = "passw0rd";

        try {
            Class.forName(JDBC_DRIVER);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }

        Connection conn = DriverManager.getConnection(JDBC_URL, JDBC_USERNAME, JDBC_PASSWORD);
        return conn;
    }

    protected List<String> getIDList() {
        int startNumber = 1;
        int size = 10;
        List<String> list = new ArrayList<String>();
        for (int i = 0; i < size; i++) {
            int n = startNumber + i;
            list.add(String.valueOf(n));
        }

        return list;
    }

}
